package com.itcast.activiti.service;

import com.itcast.activiti.utils.ActivitiPage;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.history.HistoricVariableInstance;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface IHistoryService {

    // 获取流程实例分页数据
    ActivitiPage listHistoricProcessInstancePage(ActivitiPage activitiPage);

    // 查询流程执行任务记录
    ActivitiPage listHistoricTaskInstancePage(ActivitiPage activitiPage);

    // 查询历史流程实例
    HistoricProcessInstance getHistoricProcessInstanceByBusinessKey(String businessKey, String tenantId);

    // 查询流程历史步骤
    List<Map<String, Object>> listHistoricActivityInstanceByBusinessKey(String businessKey, String tenantId);

    Map<String, Object> listHistoricActivityInstanceByBusinessKeyDesc(String businessKey, String tenantId);

    // 获取历史流程任务
    List<HistoricTaskInstance> getHistoryTaskListByProcessInstanceId(String processInstanceId, String sort);

    // 获取此历史活动实例
    List<HistoricActivityInstance> getHistoricActivityInstanceByExecutionId(String executionId);

    // 获取任务变量
    List<HistoricVariableInstance> getHistoricVariableByTaskId(String taskId, String variableName);

    // 获取任务变量
    List<HistoricVariableInstance> getHistoricVariableByProcessInstanceId(String processInstanceId, String variableName);

    // 获取任务审批状态
    boolean getTaskAuditType(String taskId);

    // 获取历史审批人
    Set<String> getHistoricAssignee(String businessKey, String tenantId);

    // 获取下一审批任务
    Map<String, Object> getNextTask(String businessKey, String tenantId, String taskId);


}
